home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / c1.zip / FABS.ASM < prev    next >
Assembly Source File  |  1987-06-18  |  3KB  |  57 lines

  1. EXTRN  FABSMB    : FAR
  2. EXTRN  GFSEG     : FAR
  3. ;
  4. ; This routine is needed because C does near calls and FABS expects
  5. ;   a far. Since we needed the assembler routine we did some other
  6. ;   set-up stuff here, instead of in the C routine that calls this.
  7. ;
  8.        PUBLIC    CALLFB
  9. CALLFB PROC      NEAR
  10.        PUSH      BP
  11.        MOV       BP,SP
  12.        MOV       BX,[BP+08]     ; Address of command
  13.        PUSH      BX             ; Save command address
  14.        MOV       AX,[BP+06]     ; Length of string
  15.        MOV       WORD PTR [BX],AX    ; Save string length
  16.        MOV       AX,[BP+04]     ; Address of string
  17.        MOV       WORD PTR [BX+02],AX ; Save address of the string
  18.        MOV       AX,[BP+10]     ; Error
  19.        PUSH      AX             ; Save error address
  20.        MOV       AX,[BP+12]     ; Record number
  21.        PUSH      AX             ; Save record number
  22.        MOV       AX,[BP+14]     ; Address of key
  23.        PUSH      AX             ; Save the address of the key
  24.        CALL      FABSMB
  25.        MOV       SP,BP          ; Restore my stack pointer
  26.        POP       BP
  27.        RET
  28. CALLFB ENDP
  29.        PUBLIC    CALLKY
  30. CALLKY PROC      NEAR
  31.        PUSH      BP
  32.        MOV       BP,SP
  33.        PUSH      DS             ; Save the DS
  34.        PUSH      AX             ; Move anything onto stack
  35.        MOV       AX,SP          ; Now point to anything
  36.        PUSH      AX             ; Now point to anything
  37.        CALL      GFSEG          ; Get the segment
  38.        POP       DS             ; Move in key segment
  39.        MOV       SI,[BP+08]     ; Address of source
  40.        MOV       CX,[BP+06]     ; Length of key
  41.        MOV       DI,[BP+04]     ; Address of destination
  42.        CLD                      ; Set auto increment
  43.        REP       MOVSB          ; Move the bytes
  44.        XOR       AX,AX          ; Zero AX
  45.        STOSB                    ; Store 0 in end of string
  46.        POP       DS             ; Restore the DS
  47.        MOV       SP,BP          ; Restore my stack pointer
  48.        POP       BP
  49.        RET
  50. CALLKY ENDP
  51.  BP
  52.        RET
  53. CALLKY ENDP
  54.  BP
  55.        RET
  56. CALLKY ENDP
  57.